<template>
  <div class="sales-3d-card" :style="{ '--main-color': mainColor }">
    <div class="sales-3d-num">{{ amount.toLocaleString() }}</div>
    <div class="sales-3d-halo">
      <div class="halo halo1"></div>
      <div class="halo halo2"></div>
      <div class="halo halo3"></div>
      <div class="halo-particles"></div>
    </div>
    <div class="sales-3d-label">{{ label }}</div>
  </div>
</template>

<script setup>
import { computed } from 'vue';
const props = defineProps({
  amount: { type: Number, required: true },
  color: { type: String, default: 'blue' },
  label: { type: String, default: '销售额' }
});
const colorMap = {
  blue: '#00f0ff',
  yellow: '#ffe066',
  green: '#00ffb0'
};
const mainColor = computed(() => colorMap[props.color] || '#00f0ff');
</script>

<style scoped>
.sales-3d-card {
  width: 120px;
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  background: transparent;
  margin: 0 8px;
}
.sales-3d-num {
  font-size: 36px;
  font-weight: bold;
  color: var(--main-color);
  text-shadow: 0 0 18px var(--main-color), 0 0 4px #fff;
  margin-bottom: 8px;
  letter-spacing: 2px;
  z-index: 2;
  animation: salesNumFloat 2.2s infinite ease-in-out alternate;
}
@keyframes salesNumFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}
.sales-3d-halo {
  position: relative;
  width: 100px;
  height: 60px;
  margin-bottom: 8px;
  z-index: 1;
}
.halo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  pointer-events: none;
}
.halo1 {
  width: 90px;
  height: 18px;
  border: 2.5px solid var(--main-color);
  box-shadow: 0 0 18px 2px var(--main-color);
  opacity: 0.7;
  top: 18px;
  animation: haloPulse 2.5s infinite linear;
}
.halo2 {
  width: 70px;
  height: 10px;
  border: 2px dashed var(--main-color);
  opacity: 0.5;
  top: 30px;
  animation: haloRotate 3.5s infinite linear;
}
.halo3 {
  width: 50px;
  height: 6px;
  border: 1.5px solid var(--main-color);
  opacity: 0.3;
  top: 38px;
  animation: haloPulse2 2.8s infinite linear;
}
@keyframes haloPulse {
  0% { opacity: 0.7; }
  50% { opacity: 0.3; }
  100% { opacity: 0.7; }
}
@keyframes haloPulse2 {
  0% { opacity: 0.3; }
  50% { opacity: 0.7; }
  100% { opacity: 0.3; }
}
@keyframes haloRotate {
  0% { transform: translateX(-50%) rotate(0deg); }
  100% { transform: translateX(-50%) rotate(360deg); }
}
.halo-particles {
  position: absolute;
  left: 50%;
  top: 0;
  width: 80px;
  height: 60px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
}
.halo-particles::before, .halo-particles::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--main-color);
  opacity: 0.5;
  filter: blur(1.5px);
}
.halo-particles::before {
  top: 8px;
  margin-left: -20px;
  animation: particleFloat1 2.2s infinite linear;
}
.halo-particles::after {
  top: 18px;
  margin-left: 18px;
  animation: particleFloat2 2.8s infinite linear;
}
@keyframes particleFloat1 {
  0% { opacity: 0.5; top: 8px; }
  50% { opacity: 1; top: 2px; }
  100% { opacity: 0.5; top: 8px; }
}
@keyframes particleFloat2 {
  0% { opacity: 0.5; top: 18px; }
  50% { opacity: 1; top: 6px; }
  100% { opacity: 0.5; top: 18px; }
}
.sales-3d-label {
  color: #fff;
  font-size: 16px;
  margin-top: 8px;
  letter-spacing: 2px;
  text-align: center;
  text-shadow: 0 0 8px #00f0ff99;
}
</style> 